﻿'
' Copyright (c) 2010-2012, MatthiWare
'
' Permission is hereby granted, free of charge, to any person obtaining a
' copy of this software and associated documentation files (the "Software"),
' to deal in the Software without restriction, including without limitation
' the rights to use, copy, modify, merge, publish, distribute, sublicense,
' and/or sell copies of the Software, and to permit persons to whom the
' Software is furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in
' all copies or substantial portions of the Software. 
' You shall include 'MatthiWare' in the credits/about section of the program
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
' FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
'

Public Class InvSlotInfo

    Public Item As Item = Nothing
    Public Stack As Int32 = 0

    Public Sub New(e As Core.Base.GameCoreEventArgs)
        Item = New Item(e)
    End Sub

    Public Overrides Function ToString() As String
        Dim str As String = Item.Name & IIf(Stack > 1, " (" & Stack & ")", "") & vbNewLine

        If (Item.IsEquipAble) Then
            str &= "Equipable" & vbNewLine
        End If

        If (Item.IsConsumable) Then
            str &= "Consumable" & vbNewLine
            If (Item.Heals > 0) Then str &= "Restores " & Item.Heals & " life" & vbNewLine
        End If

        If (Item.IsPlacable) Then str &= "Material" & vbNewLine

        If (Item.IsMagicWeapon) Then str &= Item.MagicDamage & " magic damage" & vbNewLine
        If (Item.MeleeDamage) Then str &= Item.MeleeDamage & " melee damage" & vbNewLine
        If (Item.IsRangeWeapon) Then str &= Item.RangeDamage & " ranged damage" & vbNewLine

        If (Item.IsPickaxe) Then str &= "Can mine rocks" & vbNewLine

        Return str
    End Function

End Class
